package entity

import (
	"time"

	"gorm.io/gorm"
	"shqsoft.cn/pas3ui/base"
)

//CompZsFlowChUpdate
type CompZsFlowChUpdate struct {
	JLID    int             `gorm:"column:JLID;primary_key;"`
	CUNM    string          `gorm:"column:CUNM"`
	ITNO    string          `gorm:"column:ITNO"`
	ITNM    string          `gorm:"column:ITNM"`
	DATA_DT time.Time       `gorm:"column:DATA_DT"`
	CYNM    string          `gorm:"column:CYNM"`
	ZSJE    float64         `gorm:"column:ZSJE"`
	TPID    int             `gorm:"column:TPID"`
	Bgqdivi []base.DiviDesc `gorm:"-" json:"Bgqdivi"`
}

//TableName
func (CompZsFlowChUpdate) TableName() string {
	return "V_CM_BIZ_FEE_SUM_M_UPDATE"
}

// AfterFind 查询后触发器
func (i *CompZsFlowChUpdate) AfterFind(tx *gorm.DB) (err error) {
	d, err := base.GetDiviMap(base.BizFee, i.JLID)
	if err != nil {
		return err
	}
	i.Bgqdivi, err = d.GetDesc()
	return
}
func CompZsFlowChUpdateEF() base.EntityFunc {
	return func() interface{} {
		entity := CompZsFlowChUpdate{}
		return &entity
	}
}
func CompZsFlowChUpdateESF() base.EntitiesFunc {
	return func() interface{} {
		var entities []CompZsFlowChUpdate
		return &entities
	}
}

func init() {
	base.DaoPoolObj.Put("DictMidoType", base.NewDefaultDao(DictMidoTypeEF(), DictMidoTypeESF(), nil, "ch"))
	base.DaoPoolObj.Put("CompZsFlowChUpdate", base.NewDefaultDao(CompZsFlowChUpdateEF(), CompZsFlowChUpdateESF(), nil, "ch"))
}
